﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="common/taglibs.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
    	<title>Job定义目录</title>
<jsp:include page="common/header.jsp"/>
		<script type="text/javascript">
			$(function(){
				$("input[name=id]:radio").click(function(){
					var tr = $(this).parent().parent();
					$("input[name=name]").val($(":nth-child(2)", tr).text().trim());
					$("input[name=description]").val($(":nth-child(3)", tr).text());
				});
			});
		</script>
	</head>
	<body>
<jsp:include page="common/body-header.jsp"/>
		<form action="catalogs.action" method="post">
		<b>Catalogs</b>
		<table>
			<tr>
				<th>&nbsp;</th>
				<th>Name</th>
				<th>Description</th>
				<th>Owner</th>
				<th>CreateTime</th>
				<th>ModifyTime</th>
				<th>Modifier</th>
			</tr>
			<c:forEach var="cat" items="${ss:allCatalogs(catalogController)}">
			<tr>
				<td><input type="radio" name="id" value="${cat.id}"<c:if test="${cat.id == id}"> checked="checked"</c:if>></td>
				<td>${ss:getCatalogDeepName(catalogController, cat)}</td>
				<td>${cat.description}</td>
				<td>${cat.owner}</td>
				<td>${ss:dateFormat(cat.createTime)}</td>
				<td>${ss:dateFormat(cat.modifyTime)}</td>
				<td>${cat.modifier}</td>
			</tr>
			</c:forEach>
		</table>
		<hr>
		<c:if test="${message!=null}"><div style="color: red;">${message}</div></c:if>
		<div id="actions">
			<input type="text" name="name" value="${name}">
			<input type="text" name="description" value="${description}">
			<input type="hidden" name="change">
			<input type="submit" value="新增" onclick="this.form.change.value='add'">
			<input type="submit" value="修改" onclick="this.form.change.value='update'">
			<input type="submit" value="删除" onclick="this.form.change.value='remove'">
			<input type="submit" value="移动" onclick="this.form.change.value='move'">
			<select name="parent">
			<c:forEach var="cat" items="${ss:allCatalogs(catalogController)}">
				<option value="${cat.id}"<c:if test="${parent==cat.id}"> selected="selected"</c:if>>${ss:getCatalogDeepName(catalogController, cat)}</option>
			</c:forEach>
			</select>
		</div>
		</form>
<jsp:include page="common/body-footer.jsp"/>
	</body>
</html>
